﻿@using Cnm.Models.Admins
@model List<ControlType>
@if (Model != null)
{
    foreach (ControlType control in Model)
    {
        switch (control)
        {
            case ControlType.Create:
                {
                    <a href="@Url.Action("Create")" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> Thêm</a>
                }
                break;
            case ControlType.Edit:
                {
                    <a href="@Url.Action("Edit")" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i> Sửa</a>
                }
                break;
            case ControlType.SaveChange:
                {
                    <a onclick="$('[name=save]').trigger('click');" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> Lưu</a>
                    <input type="submit" name="save" class="k-button" value="Lưu" style="display: none"/>
                }
                break;
            case ControlType.SaveAndContinue:
                {
    <a onclick="$('[name=save-continue]').trigger('click');" class="btn btn-info btn-sm"><i class="fa fa-edit"></i> Lưu và Tiếp tục Sửa</a>
    <input type="submit" name="save-continue" class="k-button" value="Lưu và Tiếp tục Sửa" style="display: none" />
                }
                break;
            case ControlType.Cancle:
                {
                    <a href="@Url.Action("Index")" class="btn btn-warning btn-sm"><i class="fa fa-undo"></i> Bỏ qua</a>
                }
                break;
        }
    }
}